8d12a3
@@ -2168,13 +2168,23 @@
public static String checkJDOPushDown(Table tab, ExprNodeDesc expr) {
       if (!supportedJDOFuncs(func)) {
         return "Expression " + expr.getExprString() + " cannot be evaluated";
       }
+      boolean allChildrenConstant = true;
       List<ExprNodeDesc> children = funcDesc.getChildExprs();
       for (ExprNodeDesc child: children) {
+        if (!(child instanceof ExprNodeConstantDesc)) {
+          allChildrenConstant = false;
+        }
         String message = checkJDOPushDown(tab, child);
         if (message != null) {
           return message;
         }
       }
+
+      // If all the children of the expression are constants then JDO cannot parse the expression
+      // see Filter.g
+      if (allChildrenConstant) {
+        return "Expression " + expr.getExprString() + " has only constants as children.";
+      }
       return null;
     }
     return "Expression " + expr.getExprString() + " cannot be evaluated";
